<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.control.PostControl" %>
<%@ page import="com.model.Post" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String post=request.getParameter("post");
int admin_id=(Integer)session.getAttribute("user_id");
Post ps=new Post();
PostControl pc=new PostControl();
ps.setAdmin_id(admin_id);
ps.setPost_content(post);
//System.out.print(post);
if(pc.insertPost(ps))
{
	%>
	<script>
	if(window.confirm("发布成功,是否继续发布！"))
		window.location.href="publish_post.jsp";
	else
		window.location.href="post_show.jsp"
	</script>
	<%}else{ %>
	<script>
	alert("发布失败！");
	window.location.href="post_show.jsp"
	</script>
	<%} %>
</body>
</html>